package com.zyj.myapplication.Model;

import com.zyj.myapplication.Javabean.Activity;
import com.zyj.myapplication.Javabean.ActivityInfo;
import com.zyj.myapplication.Service.ActivityService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/10/19.
 */

public class ActivityModel {
    private Retrofit retrofit;
    public ActivityModel(){
        retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl("http://172.24.10.175/workout/api.php/")
                .build();
    }
    public Call<List<Activity>>getactivitylist(){
        ActivityService activityService = retrofit.create(ActivityService.class);
        return activityService.getActivityList();
    }
    public Call<ActivityInfo>getactivityinfo(String id){
        ActivityService activityService = retrofit.create(ActivityService.class);
        return activityService.getActivityinfo("lgj98rfkiqvenhrk2o7oe2po81","activity",id);
    }
    public Call<Integer> signAct(String participantname,String act_id,String participanttel,String adultnum,String studentnum,String paytype,
                                 String pay,String paynotice,int userid){
        ActivityService activityService = retrofit.create(ActivityService.class);
        return activityService.signAct("signactivity",participantname,act_id,participanttel,adultnum,studentnum,paytype,pay,paynotice,"保险详细内容",userid,"lgj98rfkiqvenhrk2o7oe2po81");
    }
}
